<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org/" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
    <meta charset="UTF-8"/>
    <title sec:authentication="name"></title>
    <link rel="stylesheet" href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}"/>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title mb-0" th:text="${message}">标题</h4>
                </div>
                <div class="card-body">
                    <p class="card-subtitle mb-3">用户名：<span sec:authentication="name"></span></p>
                    <span class="card-text" sec:authorize="hasAuthority('admin')">管理员，<a th:href="@{/admin}">进入管理员界面</a></span>
                    <span class="card-text" sec:authorize="hasAuthority('user')">用户，<a th:href="@{/admin}">无法进入管理员界面</a></span>
                </div>
                <div class="card-footer">
                    <form th:action="@{/logout}" method="post">
                        <input type="submit" class="btn btn-success" value="注销"/>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>